<!DOCTYPE html>
<html lang="en" class="h-100">

<head>
  <title>Hands-On Selenium WebDriver with Java</title>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="author" content="Boni Garcia">

  <link rel="icon" type="image/png" href="img/hands-on-icon.png">

  <link href="//cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="//code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="d-flex flex-column h-100">
  <main class="flex-shrink-2">
    <div class="container">
      <div class="row py-2">
        <div class="col col-10">
          <h1 class="display-4">Hands-On Selenium WebDriver with Java</h1>
          <h5>Practice site</h5>
        </div>
        <div class="col col-2">
          <a href="https://github.com/bonigarcia/selenium-webdriver-java"><img class="img-fluid"
              src="img/hands-on-icon.png"></a>
        </div>
      </div>
      <div class="row">
        <div class="col col-12">
          <hr class="my-4">
        </div>
      </div>
      <div class="row">
        <div class="col-12">
          <h1 class="display-6">Notifications</h1>
        </div>
      </div>
      <div class="row">
        <div class="col-12 py-2">
          <button class="btn btn-outline-primary" id="notify-me">Notify me</button>
        </div>
      </div>
      <div class="row">
        <div class="col-12 py-2">
          <p class="lead" id="coordinates"></p>
        </div>
      </div>
    </div>
  </main>
  <footer class="footer mt-auto py-3 bg-light">
    <div class="container">
      <span class="text-muted">Copyright &copy; 2021-2022 <a href="https://bonigarcia.dev/">Boni Garc&iacute;a</a></span>
    </div>
  </footer>

  <script>
    document.getElementById("notify-me").addEventListener("click", function () {
      if (!Notification) {
        alert("Desktop notifications not available in your browser");
      }
      else if (Notification.permission === "granted") {
        notify();
      }
      else if (Notification.permission !== "denied") {
        Notification.requestPermission().then(function (permission) {
          if (permission === "granted") {
            notify();
          }
        });
      }
    });

    function notify() {
      var notification = new Notification("This is a notification", {
        icon: 'https://bonigarcia.dev/selenium-webdriver-java/img/hands-on-icon.png',
        body: 'Hey there!'
      });
    }
  </script>
</body>

</html>